package ${package}.entity;

import com.dragon.common.JpaBean;

import javax.persistence.*;

import lombok.*;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
* <p>
* ${tableComment} 实体类
* </p>
*
* @author ${author}
* @since ${since}
*/

@Entity
@Table(name = "${tableName}",
        uniqueConstraints = {
                @UniqueConstraint(name = "uk_id", columnNames = {"id"})
        },
        indexes = {
                @Index(name = "idx_id", columnList = "id"),
        })
@org.hibernate.annotations.Table(appliesTo = "${tableName}", comment = "${tableComment}")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@DynamicUpdate
@DynamicInsert
public class ${className}Entity extends JpaBean<${className}Entity> {
<#if columns??>
<#list columns as column>
    <#if column.fieldName!="id">
        <#if !column.isParent>
    /**
     * ${column.columnComment}
     */
    @Column(name = "${column.columnName}")
    @Comment("${column.columnComment}")
    private ${column.fieldType} ${column.fieldName};

        </#if>
    </#if>
</#list>
</#if>
} 